/*
	作者：杨金良
	*/
var urlHead = "/International";

    
var logoutUrl = urlHead + "/tea/exit";
var myTimeTableUrl = urlHead + "/teaTt/index";
var myinfoUrl = urlHead + "/teaInf/index";
var scoreRecordUrl = urlHead + "/teaScoreInput";
$("document").ready(render())


function render(){
    var header_Html = '<div id="header-title">\
                <p><span class="glyphicon glyphicon-home"></span>留学生管理系统</p>\
                </div>\
                <span id="separator"></span>\
                <div id="login-status">\
                    <div id="portrait" class="button-inline">\
                        <span class="glyphicon glyphicon-user" style="top:2px;font-size: 14px;"></span>教师<span class="glyphicon glyphicon-triangle-bottom" style="top:2px;font-size: 12px;"></span>\
                    </div>\
                    <a href="' + logoutUrl + '" id="logout" class="button-inline"><span class="glyphicon glyphicon-off" style="top:2px;font-size: 14px;"></span>注销</a>\
                </div>';
    var side_menu_Html = '<div id="mini-logo"></div>\
                <div id="menu">\
                    <ul class="am-list admin-sidebar-list">\
                        <li><a id="myTimeTable" href="' + myTimeTableUrl +'" ><span class="glyphicon glyphicon-calendar"></span> 我的课表</a></li>\
                        <li><a id="myinfo" href="' + myinfoUrl +'" ><span class="glyphicon glyphicon-edit"></span> 个人信息</a></li>\
                        <li><a id="scoreRecord" href="' + scoreRecordUrl +'" ><span class="glyphicon glyphicon-list-alt"></span> 成绩录入</a></li>\
                    </ul>\
                </div>';
    var footer_Html = '<div>Copyright &copy; 2016-2017 浙江工商大学 软件外包创新实验基地 版权所有</div>\
                    <div>地址:浙江省杭州下沙高教园区学正街18号 现代科技教育中心101机房 邮编：310018 联系电话：0571-28008316 13588202450</div><br>'
    $("#header").html(header_Html);
    $("#side-menu").html(side_menu_Html);
    $("#footer").html(footer_Html);
    $(_current_item).addClass("submenu_current_item");
}

function show(str){
    $(str).css("display","block");
}
function hide(str){
    $(str).css("display","none");
}

var domain = "127.0.0.1"; // 域
/* 设置cookie */
function setCookie(name, value) {
	/* 获取cookie工具 */
	var cookie = $.AMUI.utils.cookie;
	cookie.set(name, value, "/", domain);
}

/* 获得cookie */
function getCookie(name) {
	/* 获取cookie工具 */
	var cookie = $.AMUI.utils.cookie;
	var value = cookie.get(name);
	if (value == "undefined" || value == null || value == "null") {
		return null;
	} else {
		return value;
	}
}

/* 删除cookie */
function removeCookie(name) {
	/* 获取cookie工具 */
	var cookie = $.AMUI.utils.cookie;
	cookie.set(name, null, 0, "/", domain);
}

function removeAllCookie() {
	/* 获取cookie工具 */
	var cookie = $.AMUI.utils.cookie;
	cookie.set("pkCity", null, 0, "/", domain);
	cookie.set("cityName", null, 0, "/", domain);
	cookie.set("pkUser", null, 0, "/", domain);
}

/* 获取cookie有效时间 */
function getCookieTime() {
	end = new Date();
	end = new Date(end.valueOf() + 7 * 24 * 60 * 60 * 1000); // 7天有效
	return end;
}